home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xhearts / start_dist.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-09  |  439 b   |  28 lines

  1. /*
  2.  * autostart - start up the distributor if it's not around.
  3.  */
  4.  
  5. #include "local.h"
  6. #include "defs.h"
  7. #include <string.h>
  8.  
  9. start_distributor ()
  10. {
  11.     int    pid;
  12.     char filename[1024];
  13.  
  14.     switch (pid = fork()) {
  15.     case 0:
  16.         (void) setpgrp (0, getpid());
  17.         sprintf(filename, "%s/%s", HEARTSLIB, HEARTS_DIST);
  18.         execl (filename, "hearts_dist", 0);
  19.         exit (1);
  20.     case -1:
  21.         perror ("fork");
  22.         exit (1);
  23.     default:
  24.         while (wait (0) != pid)
  25.             ;
  26.     }
  27. }
  28.